package org.example.projecttwo.service.Impl.user;

import org.example.projecttwo.entity.user.UserStatistics;
import org.example.projecttwo.mapper.user.UserStatisticsMapper;
import org.example.projecttwo.service.Iuser.IUserStatisticsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.projecttwo.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户统计数据表 服务实现类
 * </p>
 *
 * @author nn
 * @since 2025-11-01
 */
@Service
public class UserStatisticsServiceImpl extends ServiceImpl<UserStatisticsMapper, UserStatistics> implements IUserStatisticsService {

    @Autowired
    private BaseService baseService;

    @Override
    public UserStatistics getCurrentUserStatistics() {
        Long currentUserId = baseService.getCurrentUserId();
        return this.getById(currentUserId);
    }

    @Override
    public UserStatistics getUserStatistics(Long userId) {
        return this.getById(userId);
    }
}